<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<style>
	.input-no-wrap .input-group[class*="col-"]{
		float: left;
	}
	.error {
		color: red;
	}
	.is-show{
		color: red;
		display: none;
	}
</style>
<form:form commandName="summaryFilter" cssClass="form-horizontal"
	role="form" onsubmit="return false;">
	<div class="form-group">
		<%--<label class="col-sm-2 control-label no-padding-right"
			   for="dockingTown">*组别</label>
		<div class="col-sm-4">
			<input type="text" name="teamClass" placeholder="组别" value="${teamInfo.teamClass}" class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			   for=dockingCounty>*小分队</label>
		<div class="col-sm-4">
			<input type="text" name="teamName" placeholder="小分队" value="${teamInfo.teamName}" class="form-control ">
		</div>--%>
		<label class="col-sm-2 control-label no-padding-right" >*组别</label>

		<div class="col-sm-4">
			<select name="teamId" class="form-control required" style="width: 100%"
				data-placeholder="组别" id="team-ClassId" onchange="findtwoClass()" disabled="disabled">
				<option value="${currentTeamInfo.teamId }">${currentTeamInfo.teamClass }</option>
				<c:forEach items="${teamClass}" var="teamClass">
					<option value="${teamClass.teamId }">${teamClass.teamClass }</option>
				</c:forEach>
			</select>
			<%--<input type="text" name="teamId" id="teamId"
				    value="${currentTeamInfo.teamClass }"
				   class="form-control required " />--%>
		</div>
		<div>
			<label class="col-sm-2 control-label no-padding-right">*小分队</label>
			<div class="col-sm-4">
				<%--<input type="text" name="teamName" id="teamName"
					   value="${currentTeamInfo.teamName }"
					   class="form-control " />--%>
				<select name="teamName" class="form-control required" style="width: 100%"
					data-placeholder="请选择分类" id="team-name" disabled="disabled">
						<option value="${currentTeamInfo.teamName }">${currentTeamInfo.teamName }</option>
				</select>
			</div>
		</div>
	</div>
<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="projectStage">*项目阶段</label>
		<div class="col-sm-4">
			<select name="projectStage" class="form-control required"  onblur="isSelectNan()"
				style="width: 100%" data-placeholder="请选择项目阶段"
				id="projectStage">
				<option value="${summaryFilter.projectStage }">${summaryFilter.projectStage }</option>
				<option value="意向项目">意向项目</option>
				<option value="在谈项目">在谈项目</option>
				<option value="评审项目">评审项目</option>
				<option value="签约项目">签约项目</option>
				<option value="已备案">已备案</option>
				<option value="已注册">已注册</option>
				<option value="审批项目">审批项目</option>
					<%--	<option value="落地项目">落地项目</option>--%>
				<option value="在建项目">在建项目</option>
				<option value="投产项目">投产项目</option>
			</select>
		</div>
		
		<%--<label class="col-sm-2 control-label no-padding-right"
			for="projectClass">项目类别</label>
		<div class="col-sm-4">
			&lt;%&ndash; <input type="text" name="projectStage" id="projectStage" placeholder="请选择项目类别" value="${summaryFilter.projectStage}" class="form-control "> &ndash;%&gt;
			<select name="projectClass" class="form-control" style="width: 100%"
				data-placeholder="请选择项目类别" id="projectClass">
				<option value="${summaryFilter.projectClass }">${summaryFilter.projectClass }</option>
				<option value="大项目、好项目">大项目、好项目</option>
				<option value="一般项目">一般项目</option>
			</select>
		</div>--%>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="project-Name">*项目名称</label>
		<div class="col-sm-4">
			<input type="text" name="projectName" id="project-Name"
				placeholder="请输入项目名称" value="${summaryFilter.projectName}"
				class="form-control required projectName">
			<div class="is-show">该项目已申报</div>
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=investorName>*投资方名</label>
		<div class="col-sm-4">
			<input type="text" name="investorName" id="investorName"
				placeholder="请输入投资方名称" value="${summaryFilter.investorName}"
				class="form-control required">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="dockingTown">乡（镇）</label>
		<div class="col-sm-4">
			<input type="text" name="dockingTown" id="dockingTown"
				placeholder=" 面对负责对接的单位或部门的乡镇" value="${summaryFilter.dockingTown}"
				class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=dockingCounty>县直单位</label>
		<div class="col-sm-4">
			<input type="text" name="dockingCounty" id="dockingCounty"
				placeholder="面对负责对接的单位或部门的县直、市直单位 "
				value="${summaryFilter.dockingCounty}" class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<%--<label class="col-sm-2 control-label no-padding-right" for="leader">领导</label>--%>
		<%--<div class="col-sm-4">--%>
			<%--<input type="text" name="leader" id="leader" placeholder=" 请输入领导"--%>
				<%--value="${summaryFilter.leader}" class="form-control ">--%>
		<%--</div>--%>

		<label class="col-sm-2 control-label no-padding-right" for=belongArea>归属地</label>
		<div class="col-sm-4">
			<input type="text" name="belongArea" id="belongArea"
				placeholder="请输入归属地" value="${summaryFilter.belongArea}"
				class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="projectContent">*项目内容和规模</label>
		<div class="col-sm-4">
			<%-- <input type="text" name="projectContent" id="projectContent" placeholder="项目内容和规模" value="${summaryFilter.projectContent}" class="form-control "> --%>
			<textarea class="form-control required" rows="5" name="projectContent"
				id="projectContent" placeholder="项目内容和规模">${summaryFilter.projectContent}</textarea>
		</div>

		<%--<label class="col-sm-2 control-label no-padding-right"
			for=projectProgress>*项目进展情况</label>
		<div class="col-sm-4">
			<textarea class="form-control required" rows="5" name="projectProgress"
				id="projectProgress" 
				placeholder="应简要体现项目重大进展，依次叠加补充，适当控制字数，称谓上应使用第三人称，时间上应使用绝对时间，如12月15日">${summaryFilter.projectProgress}</textarea>
		</div>--%>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="area">*地区国别</label>
		<div class="col-sm-4">
			<input type="text" name="area" id="area" placeholder=" 请输入国别或地区"
				value="${summaryFilter.area}" class="form-control required">
		</div>

		<label class="col-sm-2 control-label no-padding-right" for=attribute>*三维属性</label>
		<div class="col-sm-4">
			<select name="attribute" class="form-control required"
				style="width: 100%" data-placeholder="请选择三维属性"
				id="attribute">
				<option value="${summaryFilter.attribute }">${summaryFilter.attribute }</option>
				<option value="国企">国企</option>
				<option value="外企">外企</option>
				<option value="央企">央企</option>
				<option value="民企">民企</option>
			</select>
		</div>
	</div>


	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="industrialClassfly">*产业分类</label>
		<div class="col-sm-4">
			<%-- 			<input type="text" name="industrialClassfly" id="industrialClassfly" placeholder="产业分类" value="${summaryFilter.industrialClassfly}" class="form-control "> --%>
			<select name="industrialClassfly" class="form-control required"
				style="width: 100%" data-placeholder="请选择产业分类"
				id="industrialClassfly">
				<option value="${summaryFilter.industrialClassfly }">${summaryFilter.industrialClassfly }</option>
				<option value="一产">一产</option>
				<option value="二产">二产</option>
				<option value="三产">三产</option>
			</select>
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=industrialConcrete>*具体分类</label>
		<div class="col-sm-4">
			<%-- <input type="text" name="industrialConcrete" id="industrialConcrete" placeholder="填写农林水、工业、制造业、能源、大数据物联网、商贸、交通、城市基础设施、旅游、金融业、社会公共事业、服务业" value="${summaryFilter.industrialConcrete}" class="form-control "> --%>
			<select name="industrialConcrete" class="form-control required"
				style="width: 100%" data-placeholder="请选择具体分类"
				id="industrialConcrete">
				<option value="${summaryFilter.industrialConcrete }">${summaryFilter.industrialConcrete }</option>

				<option value="农林牧渔业">农林牧渔业</option>
				<option value="工业">工业</option>
				<option value="建筑业">建筑业</option>
				<option value="服务业">服务业</option>
				<option value="金融">金融</option>
				<option value="批发和零售业">批发和零售业</option>
				<option value="仓储和邮政业">仓储和邮政业</option>
				<option value="软件和信息技术">软件和信息技术</option>
				<option value="社会公共事业">社会公共事业</option>
				<option value="物联网">物联网</option>
				<option value="大数据">大数据</option>
				<option value="旅游">旅游</option>
				<option value="文教">文教</option>
				<option value="卫计">卫计</option>
				<option value="其他">其他</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" >*使用方式：</label>
		<%--<div class="col-sm-4">
			<input  type="radio" name="groundused" value="供地" >供地
			<input  type="radio" name="groundused" value="租赁土地" >租赁土地
			<input  type="radio" name="groundused" value="租赁楼宇" >租赁楼宇
		</div>--%>
	<div class="col-sm-4">
		<select name="groundused" class="form-control required"
				style="width: 100%" data-placeholder="请选择土地使用方式"
				id="">
			<option value="${summaryFilter.groundused }">${summaryFilter.groundused}</option>
			<%--<option >请选择</option>--%>
			<option value="供地">供地</option>
			<option value="租赁土地">租赁土地 </option>
			<option value="租赁楼宇">租赁楼宇</option>

		</select>
	</div>

	</div>
	<div class="form-group input-no-wrap">
		<label class="col-sm-2 control-label no-padding-right"
			for="total-Inver">*合计</label>
		<div class="col-sm-4 input-group">

			<input type="number" name="totalInver" id="total-Inver" placeholder="合计"
				value="${summaryFilter.totalInver}" class="form-control required" step="0.01">
			<span class="input-group-addon   "   >亿元</span>
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for="domesticInver">内资</label>
		<div class="col-sm-4 input-group">

			<input type="number" name="domesticInver" id="domesticInver" step="0.01"
				placeholder="总投资-内资-(亿元)" value="${summaryFilter.domesticInver}"
				class="form-control "> <span class="input-group-addon">亿元</span>
		</div>
	</div>
	<div class="form-group input-no-wrap">
		<label class="col-sm-2 control-label no-padding-right"
			for="foeignInver">外资</label>
		<div class="col-sm-4 input-group">

			<input type="number" name="foeignInver" id="foeignInver" step="0.01"
				placeholder="总投资-外资-(亿元)" value="${summaryFilter.foeignInver}"
				class="form-control "> <span class="input-group-addon">万美元</span>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="projectManager">*责任人</label>
		<div class="col-sm-4">
			<input type="text" name="projectManager" id="projectManager"
				placeholder=" 请输入责任领导" value="${summaryFilter.projectManager}"
				class="form-control required">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=fenguanLeader>*分管领导</label>
		<div class="col-sm-4">
			<input type="text" name="fenguanLeader" id="fenguanLeader"
				placeholder="请输入分管领导" value="${summaryFilter.fenguanLeader}"
				class="form-control required">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="contacts">*联系人</label>
		<div class="col-sm-4">
			<input type="text" name="contacts" id="contacts"
				placeholder=" 请输入联系人（电话）" value="${summaryFilter.contacts}"
				class="form-control required">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=fenguanLeader>备注</label>
		<div class="col-sm-4">
			<input type="text" name="notes" id="notes" placeholder="如需备注请输入"
				value="${summaryFilter.notes}" class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="companyContacts">*企业联系人</label>
		<div class="col-sm-4">
			<input type="text" name="companyContacts" id="companyContacts"
				placeholder="请输入企业联系人" value="${summaryFilter.companyContacts}"
				class="form-control required">
		</div>


	</div>

	<div class="form-group">
	<label class="col-sm-2 control-label no-padding-right" for="realNum">*实际个数</label>
	<div class="col-sm-4">
		<input type="number" name="realNum" id="realNum" step="0.01"
			   value="${summaryFilter.realNum}" class="form-control required"
		/>
	</div>

		<label class="col-sm-2 control-label no-padding-right" for="real-Inver">*实际金额</label>
		<div class="col-sm-4">
			<input type="number" name="realInver" id="real-Inver" step="0.01"
				   value="${summaryFilter.realInver}" class="form-control required"
			/>
		</div>
	</div>


	<!--<label class="col-sm-1 control-label no-padding-right" for=registerDate>注册备案时间</label>
		<div class="col-sm-5">
			<input type="text" name="registerDate" id="registerDate" placeholder="请输入注册备案时间" value="${summaryFilter.registerDate}" class="form-control ">
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-1 control-label no-padding-right" for="countyEvaluation">县考评</label>
		<div class="col-sm-5">
			<input type="text" name="countyEvaluation" id="countyEvaluation" placeholder="县考评" value="${summaryFilter.countyEvaluation}" class="form-control ">
		</div>
		
		<label class="col-sm-1 control-label no-padding-right" for=reported>已上报招商办</label>
		<div class="col-sm-5">
			<input type="text" name="reported" id="reported" placeholder="请输入注册备案时间" value="${summaryFilter.reported}" class="form-control ">
		</div>
	</div>
	
	<div class="form-group">
	<%-- 	<label class="col-sm-1 control-label no-padding-right" for="taxproof">佐证材料</label>
		<div class="col-sm-5">
			<input type="text" name="taxproof" id="taxproof" placeholder="税收证明" value="${summaryFilter.taxproof}" class="form-control ">
		</div> --%>
		
		<label class="col-sm-1 control-label no-padding-right" for=investplan>项目投资进度计划表</label>
		<div class="col-sm-5">
			<input type="text" name="investplan" id="investplan" placeholder="项目投资进度计划表" value="${summaryFilter.investplan}" class="form-control ">
		</div>
	</div>-->


	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" >佐证材料</label>
		<input class="col-sm-4" type="file" id="fileupload" name="files"
			accept=".zip"></input> <br>

		<button class="col-sm-4 btn btn-large btn-primary" id="btn">上传</button>

		<input type="text" name="taxproof" id="taxproof_proof"
			value="${summaryFilter.taxproof}" class="form-control " style="display: none"
			 />
		<input type="text" name="isaudit" id="isaudit"
			value="${summaryFilter.isaudit}" class="form-control " style="display: none"
			 />
		<input type="text" name="teamClass" id="teamClass_" style="display: none"
			value="${currentTeamInfo.teamClass}" class="form-control "
			 />
		<input type="text" name="datatime" id="datatime"
			   value="${summaryFilter.datatime}" class="form-control "  style="display: none"
		/>
		<input type="text" name="firstReportDate" id="firstReportDate"
			   value="${summaryFilter.firstReportDate}" class="form-control "  style="display: none"
		/>
		<input type="text" name="remark"
			   value="${summaryFilter.remark}" class="form-control "  style="display: none"
		/>

	</div>


	<!-- <div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"
			for="optionA">分类</label>
			
	</div>  -->



	<form:hidden path="sysId" />
</form:form>
<%--<%@ include file="/WEB-INF/views/include/footer.jsp"%>--%>
<%--<script src="<s:url value="/assets/js/modal/modal.js"></s:url>"</script>--%>
<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/jquery-ui.js"></s:url>"></script>

<%--<div id="dialog" title="提示">
	<div class="progress progress-striped active">
		<div class="progress-bar progress-bar-success" role="progressbar"
			aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
			style="width: 100%;"></div>

	</div>
	<p>正在上传 请稍后……</p>
</div>--%>

<script type="text/javascript">
	$('#editor1').ace_wysiwyg({
		toolbar : [ 'font', null, 'fontSize', null, {
			name : 'bold',
			className : 'btn-info'
		}, {
			name : 'italic',
			className : 'btn-info'
		}, {
			name : 'strikethrough',
			className : 'btn-info'
		}, {
			name : 'underline',
			className : 'btn-info'
		}, null, {
			name : 'createLink',
			className : 'btn-pink'
		}, {
			name : 'unlink',
			className : 'btn-pink'
		}, null, {
			name : 'insertImage',
			className : 'btn-success'
		}, null, 'foreColor', null, {
			name : 'undo',
			className : 'btn-grey'
		}, {
			name : 'redo',
			className : 'btn-grey'
		} ]
	});
	//settingOneCheckTreeParam('#deptRelation','#deptRelation','resourceTree','#resourceTree','#resourceContent','<s:url value="/modules/sys/dept/json"></s:url>','#deptLevel','${sysDept.sysId}');

	/* settingOneCheckTreeParam({
		inputObjKey : '#deptRelation',
		treeObjName : 'resourceTree',
		treeContentKey : '#resourceContent',
	url : '<s:url value="/modules/sys/dept/json"></s:url>',
	levelKey : '#deptLevelForm',
	sysId : '${QuestionBank.sysId}'
	}); */

/*	$("#dialog").hide();*/
	$("#btn").click(function() {
		var fileval = $("#fileupload").val();
		if (fileval == null || fileval == "") {
			alert("未选择任何文件");
			return;
		}
/*
		$("#dialog").show();
		$("#dialog").dialog();*/
        $(".shade").fadeIn(100);
        $(".warning").fadeIn(100);
        $('.la-square-jelly-box').show();
        showShade();
        //警告框自定义内容
        $('.warning>.title>em').html('加载中……');
		$.ajaxFileUpload({
			type : "post",
			fileElementId : "fileupload",
			secureuri : false,
			dataType : 'json',
			url : "/pictureUpload/uploadBatch",
			async : false,
			success : function(data) {
				var val = data.data.sysid;
				console.log(val);
				$("#taxproof_proof").attr("value", val);
				/*$("#dialog").dialog("close");*/
                $('.warning>.title>em').html('上传成功');
                $('#btn').html('文件已上传');
				//console.log( $("#taxproof_proof").val() +":jlk ");
				//alert("成功");
			},
			error : function(data) {
				/*$("#dialog").dialog("close");*/
				alert("上传失败 ！！请联系管理员");
			}

		});

	});
	
	function inContains(str,substr){
		return str.indexOf(substr)>=0;
	}
	//更新 权限 
	//var projectStage = $("#projectStage").val();
	//console.log(projectStage+"huangyupengshipaowang");
	//var str = "在谈项目,意向项目,评审项目,签约项目";
	//console.log(inContains(str,projectStage));
	/*if(inContains(str,projectStage)){
		$("#updatebtn").attr("disabled", true);
		
	} */
	
	function findtwoClass() {
		var teamID = $("#team-ClassId").val();
		var teamClassname = $("#team-ClassId").find("option:selected").text();
		$("#teamClass_").attr("value",teamClassname);
        //console.log(teamID);

		var teamcla = {
			"teamId" : teamID
		};

		$.ajax({
			url : "/chart/show/getTeamclassNames",
			dataType : "json", //返回数据形式为json
			type : "POST",
			contentType : 'application/json;charset=UTF-8',
			data : JSON.stringify(teamcla),
                success : function(data) {
				$("#team-name option").remove();
				//$("#team-name").append(" <option >请选择</option>");
				for (var i = 0; i < data.data.length; i++) {
					var teamid = data.data[i].teamId;
					var teamname = data.data[i].teamName;
					$("#team-name").append(
							"<option value='"+teamname+"'>" + teamname
									+ "</option>");
					//console.log(teamname);
				}
			}
		});
	}
	//-------实际金额失去焦点事件-------

    $("#real-Inver").blur(function () {
        console.log(111);
        var totalinver_money =$("#total-Inver").val();
        var real_Inver_money =$("#real-Inver").val();
        if(parseFloat(totalinver_money)-parseFloat(real_Inver_money)<0)
        {
            //alert("实际投资不能大于合计金额。请重新填写");

            $(".shade").fadeIn(100);
            $(".warning").fadeIn(100);
            showShade();
            //警告框自定义内容
            $('.warning>.cont').html('实际投资不能大于合计金额。请重新填写');
            $('.la-square-jelly-box').hide();
            $("#real-Inver").val("");
        }

    });

	//-----end ---------
    /*$('#realInver').on('blur',function () {

    })*/
    $('#realInver').blur(function () {
		console.log(111)
    });
    //--------项目名是否重复-----
    $("#project-Name").blur(function(){
       var projectName=$(this).val();
       var date=new Date();
       var newYear=date.getFullYear();
		if(!projectName){
		    return
		}
        $.ajax({
            url:"/modules/sys/invest/isrRpeatName",
            data:JSON.stringify({'projectName':projectName,'datatime':newYear}),
            type : "POST",
            contentType : "application/json;charset=UTF-8",
            dataType:"json",
            success: function(res){
                console.log(res);
                res.data==1?$(".is-show").show():$(".is-show").hide();
            }
        })
    });
    function isSelectNan() {
		console.log($('#team-ClassId').val());
		if($('#team-ClassId').val() ==''){
		    alert('组别不能为空')
		}
		if($('#team-name').val()===''){
		    alert('小分队不能为空')
		}
    }
</script>
